package com.ccdc.lbcmsystem.mapper;

import com.ccdc.lbcmsystem.pojo.Notice;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@Mapper
@Component
public interface NoticeMapper {
    //查询显示在首页的公告
    Notice queryStatus();
    //根据主题查询
    List<Notice> queryListByTheme(@RequestParam("theme") String theme);
    //查询所有公告
    List<Notice> queryList();
    //根据ID查询信息
    Notice queryNoticeById(@RequestParam("id") Integer id);
    //新增公告
    int addNotice(@RequestParam("notice") Notice notice);
    //根据ID删除公告
    int delNotice(@RequestParam("id") Integer id);
    //根据ID修改公告
    int editNoticeById(@RequestParam("id") Integer id,@RequestParam("theme") String theme,
                           @RequestParam("content") String content);
    //将上架的公告状态改为下架
    int editNotice();
    //根据ID修改公告上下架状态
    int editNoticeStatusById(@RequestParam("id") Integer id,@RequestParam("status") Integer status);
}
